
<div ng-controller="StorageCtrl">
	
<div ng-include="'/templates/paramsSelect.html'"></div>
	<div class="page-heading">
		<ul class="breadcrumb">
			<li><a href="javascript:;">财务统计</a></li>
			<li class="active">车辆进销存</li>
		</ul>
	</div>
	<!-- 页面头部  end-->

	<!--页面内容显示区域-->
	<div class="wrapper">


		<div class="row">
			<div class="col-sm-12">
				<!--表格显示区域-->
				<section class="panel">
					<!--区块头 显示表格名称和功能按钮-->
					<header class="panel-heading">
						车辆信息
						<!--控制按钮-->
						<span class="tools pull-right"> <!--收起-->
							<button type="button" class="btn btn-success pull-left"
								style="margin-left: 5px;" ng-click="SearchData();">
								<i class="fa fa-search"></i> 查询
							</button>
							<button type="button" class="btn btn-info  pull-left" ng-click="ExportData()"
								style="margin-left: 5px;">
								<i class="fa fa-table"></i> 导出EXCEL
							</button> <a href="javascript:;" class="fa fa-chevron-up form_display"></a>

						</span>
					</header>
					<!--区块body 显示表格内容-->
					<div class="panel-body form-horizontal form_hide">
						<div class="row">
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">事业部</label>
										<div class="col-lg-8 col-sm-7">
										<input type="text" id="entity_group_name"  name="entity_group_name"   class="form-control select_edit form_params" />
                                            <ul class="select_list">
                                                  <li ng-repeat="e in groups" ng-click='LoadBrands(e.group_name)' val_code="{{e.group_name}}" val_name="{{e.group_name}}">{{e.group_name}}</li>
                                            </ul>  
                                            </div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">店面品牌</label>
									<div class="col-lg-8 col-sm-7">
										<input type="text" id="entity_brand_name"  name="entity_brand_name" class="form-control select_edit form_params" value=""/>
                                            <ul class="select_list">
                                                  <li ng-repeat="e in gBrands" ng-click='LoadEntitys(e)' val_code="{{e.brand_code}}" val_name="{{e.brand_name}}">{{e.brand_name}}</li>
                                            </ul> 
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label" for="inputEmail1">店面信息</label>
									<div class="col-lg-8 col-sm-7">
											<input type="text" id="entity_name" name="entity_name" class="form-control select_edit form_params" value=""/>
                                            <ul class="select_list">
                                                  <li ng-repeat="e in entitys" val_code="{{e.entity_code}}" val_name="{{e.entity_name}}">{{e.entity_name}}({{e.entity_code}})</li>
                                            </ul>  
									</div>
								</div>
							</div>

							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">品牌</label>
									<div class="col-lg-8 col-sm-7">
										<select name="brand_code"  ng-model="ch_brand" ng-change="LoadSeries(ch_brand)"  class="form-control form_params">
											<option></option>
											<option  ng-repeat="b in brands"  value="{{b.brand_code}}">{{b.brand_name}}</option>
										</select>
									</div>
								</div>
							</div>
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">车系</label>
									<div class="col-lg-8 col-sm-7">
										<select name="series_code" ng-model="ch_serie" ng-change="LoadModels(ch_serie);"    class="form-control form_params">
											<option></option>
											<option ng-repeat="b in $parent.series"   value="{{b.series_code}}">{{b.series_name}}</option>
										</select>
									</div>
								</div>
							</div>
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">车型</label>
									<div class="col-lg-8 col-sm-7">
										<select name="model_code"    class="form-control form_params">
											<option></option>
											<option ng-repeat="b in $parent.models" value="{{b.model_code}}">{{b.model_name}}</option>
										</select>
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">配置</label>
									<div class="col-lg-8 col-sm-7">
										<select name="config_code" class="form-control form_params">
											<option></option>
											<option ng-repeat="b in $parent.configs" value="{{b.config_code}}">{{b.config_name}}</option>
										</select>
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">VIN</label>
									<div class="col-lg-8 col-sm-7">
										<input name="vin" class="form-control form_params" />
									</div>
								</div>
							</div>

						</div>
					</div>
				</section>

				<section class="panel">
					<!--区块头 显示表格名称和功能按钮-->
					<header class="panel-heading">
						车辆进存销列表
						<div class="option_check_list" style="display: inline-block;"></div>

						<!--控制按钮-->
						<span class="tools pull-right"> <!--收起--> <a
							href="javascript:;" class="fa fa-chevron-down"></a>
						</span>
						<div class="pull-right"
							style="margin-right: 10px; margin-top: -6px; display: inline-block">
							<button type="button" class="btn btn-danger btn-sm " href="#paramsSelect"
								data-toggle="modal">
								<i class="fa fa-plus"></i> 在结果集中筛选
							</button>
							<button type="button" class="btn btn-success btn-sm"
								id="search_table" ng-click="SearchData();">
								<i class="fa fa-search"></i> 查询表格
							</button>
						</div>
					</header>
					<!--区块body 显示表格内容-->
					<div class="panel-body form-horizontal ">

						<div class="adv-table" style="overflow-x: scroll">
							<table id="storageTable"
								class="table table-striped  nowrap  dataTable no-footer table_store table-hover float_head"
								cellspacing="0" width="100%">
								
								<thead>
									<tr>
										<td colspan="{{showinfo.count1}}"></td>
										<td colspan="{{showinfo.count2}}" align="center">期初库存</td>
										<td colspan="{{showinfo.count3}}" align="center">本期购入</td>
										<td colspan="{{showinfo.count4}}" align="center">本期销售成本</td>
										<td colspan="{{showinfo.count5}}" align="center">期末库存</td>
										<td colspan="{{showinfo.count6}}" align="center">本期销售</td>
										<td colspan="{{showinfo.count7}}" align="center">销售利润</td>
										<td colspan="{{showinfo.count8}}" align="center">本期开票未关单</td>
										<td colspan="{{showinfo.count9}}" align="center">期初开票本期关单</td>
										<td colspan="{{showinfo.count10}}" align="center">期初开票本期未关单</td>
									</tr>
									<tr>
										<th ng-show="!cols.contains('index')" column="index_id">序号</th>
										<th ng-show="!cols.contains('entity_code')" column="entity_code">店面编号</th>
										<th ng-show="!cols.contains('entity_name')" column="entity_name">店面名称</th>
										<th ng-show="!cols.contains('entity_brand_name')" column="entity_brand_name">店面品牌</th>
										<th ng-show="!cols.contains('entity_group_name')" column="entity_group_name">事业部</th>
										<th ng-show="!cols.contains('brand_name')"  column="brand_name">品牌</th>
										<th ng-show="!cols.contains('series_name')" column="series_name">车系</th>
										<th ng-show="!cols.contains('model_name')" column="model_name">车型</th>
										<th ng-show="!cols.contains('config_name')" column="config_name">配置</th>
										<th ng-show="!cols.contains('color_name')" column="color_name">颜色</th>
										<th ng-show="!cols.contains('inner_color_name')" column="inner_color_name">内饰色</th>
										<th ng-show="!cols.contains('vin')" column="vin">vin</th>
										
										<th column="begin_quantity">数量</th>
										<th column="begin_untax_amount">不含税金额</th>
										
										<th column="current_buy_quantity">数量</th>
										<th column="current_buy_untax_amount">不含税金额</th>
										<th column="in_adjust_cost">本期调入金额</th>
										
										<th column="current_sales_cost_quantity">数量</th>
										<th column="current_sales_cost_untax_amount">不含税金额</th>
										<th column="out_adjust_cost">本期销售调整金额</th>
										
										<th column="end_quantity">数量</th>
										<th column="end_untax_amount">不含税金额</th>
										
										<th column="current_sales_quantity">数量</th>
										<th column="current_sales_amount">不含税金额</th>
										<th column="current_sales_untax_amount">不含税金额</th>
										
										<th column="current_sales_grass_profit_amount">毛利额</th>
										<th column="current_sales_grass_profit_rate">毛利率</th>
										
										<th column="curren_kp_unclose_quantity">数量</th>
										<th column="curren_kp_unclose_amount">含税金额</th>
										<th column="curren_kp_unclose_untax_amount">不含税金额</th>
										<th column="curren_kp_unclose_untax_profit">利润额</th>
										
										<th column="begin_kp_current_close_quantity">毛利率</th>
										<th column="begin_kp_current_close_amount">含税金额</th>
										<th column="begin_kp_current_close_untax_amount">不含税金额</th>
										<th column="begin_kp_current_close_untax_profit">利润额</th>
										
										<th column="begin_kp_current_unclose_quantity">毛利率</th>
										<th column="begin_kp_current_unclose_amount">含税金额</th>
										<th column="begin_kp_current_unclose_untax_amount">不含税金额</th>
										<th column="begin_kp_current_unclose_untax_profit">利润额</th>
									</tr>
								</thead>
								<tbody>
								<tr ng-repeat="c in datas">
										<td class="">{{$index + 1 }}</td>
										<td ng-show="!cols.contains('entity_code')" column="entity_code">{{c.entity_code}}</td>
										<td ng-show="!cols.contains('entity_name')" column="entity_name">{{c.entity_name}}</td>
										<td ng-show="!cols.contains('entity_brand_name')" column="entity_brand_name">{{c.entity_brand_name}}</td>
										<td ng-show="!cols.contains('entity_group_name')" column="entity_group_name">{{c.entity_group_name}}</td>
										<td class="">{{c.brand_name}}</td>
										<td class="">{{c.series_name}}</td>
										<td class="">{{c.model_name}}</td>
										<td class="">{{c.config_name}}</td>
										<td class="">{{c.color_name}}</td>
										<td class="">{{c.inner_color_name}}</td>
										<td class="">{{c.vin}}</td>
										
										<td class="">{{c.begin_quantity}}</td>
										<td class="">{{c.begin_untax_amount}}</td>
										
										<td class="">{{c.current_buy_quantity}}</td>
										<td class="">{{c.current_buy_untax_amount}}</td>
										<td class="">{{c.in_adjust_cost}}</td>
										
										<td class="">{{c.current_sales_cost_quantity}}</td>
										<td class="">{{c.current_sales_cost_untax_amount}}</td>
										<td class="">{{c.out_adjust_cost}}</td>
										
										<td class="">{{c.end_quantity}}</td>
										<td class="">{{c.end_untax_amount}}</td>
										
										<td class="">{{c.current_sales_quantity}}</td>
										<td class="">{{c.current_sales_amount}}</td>
										<td class="">{{c.current_sales_untax_amount}}</td>
										
										<td class="">{{c.current_sales_grass_profit_amount}}</td>
										<td class="">{{c.current_sales_grass_profit_rate}}</td>
										
										<td class="">{{c.curren_kp_unclose_quantity}}</td>
										<td class="">{{c.curren_kp_unclose_amount}}</td>
										<td class="">{{c.curren_kp_unclose_untax_amount}}</td>
										<td class="">{{c.curren_kp_unclose_untax_profit}}</td>
										
										<td class="">{{c.begin_kp_current_close_quantity}}</td>
										<td class="">{{c.begin_kp_current_close_amount}}</td>
										<td class="">{{c.begin_kp_current_close_untax_amount}}</td>
										<td class="">{{c.begin_kp_current_close_untax_profit}}</td>
										
										<td class="">{{c.begin_kp_current_unclose_quantity}}</td>
										<td class="">{{c.begin_kp_current_unclose_amount}}</td>
										<td class="">{{c.begin_kp_current_unclose_untax_amount}}</td>
										<td class="">{{c.begin_kp_current_unclose_untax_profit}}</td>
										</tr>
								</tbody>
							</table>

						</div>
						<tm-pagination conf="pagination"></tm-pagination>
					</div>
				</section>
				<!--表格显示区域-->

			</div>
		</div>
	</div>
	 
	 
<form id="export_form" action="carstorage/export"  method="post">
	<input type="hidden" name="keys" id="keys" />
	<input type="hidden" name="names" id="names" /> 
	<input type="hidden" name="params" id="params" />
	<input type="hidden" name="search_opt" id="search_opt" /> 
	<input type="hidden" name="file_name" id="file_name" value="车辆进销存"/>
</form>
</div>
